<?php 
    $url = new Url();
    $controller = Yii::app()->controller->id;
    $action = Yii::app()->controller->action->id;
    $ac = $controller.'-'.$action;    
?>
<div id="header">    
    <h1><a href="<?php echo $url->createUrl("project/index",array('project'=>$_SESSION['project_pm']['project_alias'])); ?>"><?php echo $_SESSION['project_pm']['project_name']; ?></a></h1>

    <div id="main-menu">
        <ul>
            <li><a href="<?php echo $url->createUrl("project/index",array('project'=>$_SESSION['project_pm']['project_alias'])); ?>" class="overview <?php if($ac == "project-index"){echo "selected";} ?>">Tổng quan</a></li>
            <li><a href="<?php echo $url->createUrl("activity/index"); ?>" class="activity <?php if($controller == "activity"){echo "selected";} ?>">Hoạt động</a></li>
            <li><a href="<?php echo $url->createUrl("task/index"); ?>" class="issues <?php if($ac == "task-index"){echo "selected";} ?>">Công việc</a></li>
            <?php if($_SESSION['project_pm']['project_admin_id'] == $_SESSION['user_pm']['user_id']){ ?>
                <li><a href="<?php echo $url->createUrl("task/add"); ?>" accesskey="7" class="new-issue <?php if($ac == "task-add"){echo "selected";} ?>">Tạo công việc mới</a></li>
                <?php } ?>
            <li><a href="<?php echo $url->createUrl("gantt/index"); ?>" class="gantt <?php if($ac == "gantt-index"){echo "selected";} ?>">Biểu đồ sự kiện</a></li>            
            <?php if($_SESSION['project_pm']['project_admin_id'] == $_SESSION['user_pm']['user_id']){ ?>
                <li><a href="<?php echo $url->createUrl("finance/index"); ?>" class="gantt <?php if($ac == "finance-index"){echo "selected";} ?>">Tài chính</a></li>
                <?php } ?>
            <?php if($_SESSION['project_pm']['project_admin_id'] != $_SESSION['user_pm']['user_id']){ ?>
                <li><a href="<?php echo $url->createUrl("finance/add"); ?>" class="gantt <?php if($ac == "finance-add"){echo "selected";} ?>">Đề xuất tài chính</a></li>
                <?php } ?>
            <li><a href="<?php echo $url->createUrl("new/index"); ?>" class="news <?php if($controller == "new"){echo "selected";} ?>">Thông báo</a></li>                                    
            <?php if($_SESSION['project_pm']['project_admin_id'] == $_SESSION['user_pm']['user_id']){ ?>
                <li><a href="<?php echo $url->createUrl("project/detail"); ?>" class="settings <?php if($ac == "project-detail"){echo "selected";} ?>">Thiết lập</a></li>
                <?php } ?>
        </ul>
    </div>
</div>